
const RouteView = {
  name: 'RouteView',
  render: h => h('router-view')
}

export default {
  path: '/demo',
  name: 'demo',
  redirect: '/demo/diy',
  component: RouteView,
  meta: { title: '组件例子', keepAlive: true, icon: 'shop' },
  children: [
    {
      path: '/demo/diy',
      name: 'demo-diy',
      redirect: '/demo/diy/index',
      component: RouteView,
      meta: { title: '自定义', icon: 'build' },
      children: [
        {
          path: '/demo/diy/index',
          name: 'demo-diy-index',
          component: () => import(/* webpackChunkName: "diy" */ '@/views/demo/diy/Index'),
          meta: { title: '组件测试', keepAlive: true }
        },
        {
          path: '/demo/diy/page',
          name: 'demo-diy-page',
          component: () => import(/* webpackChunkName: "diy" */ '@/views/demo/diy/Page'),
          meta: { title: '分页测试', keepAlive: true }
        },
        {
          path: '/demo/diy/form',
          name: 'demo-diy-form',
          component: () => import(/* webpackChunkName: "diy" */ '@/views/demo/diy/Form'),
          meta: { title: '表单测试', keepAlive: true }
        },
        {
          path: '/demo/diy/watch',
          name: 'demo-diy-watch',
          component: () => import(/* webpackChunkName: "diy" */ '@/views/demo/diy/Watch'),
          meta: { title: '文件监控', keepAlive: true }
        }
      ]
    },
    {
      path: '/demo/dashboard',
      name: 'demo-dashboard',
      redirect: '/demo/dashboard/workplace',
      component: RouteView,
      meta: { title: '仪表盘', keepAlive: true, icon: 'dashboard' },
      children: [
        {
          path: '/demo/dashboard/analysis/:pageNo([1-9]\\d*)?',
          name: 'demo-dashboard-analysis',
          component: () => import(/* webpackChunkName: "dashboard" */ '@/views/demo/dashboard/Analysis'),
          meta: { title: '分析页', keepAlive: false }
        },
        {
          path: '/demo/dashboard/workplace',
          name: 'demo-dashboard-workplace',
          component: () => import(/* webpackChunkName: "dashboard" */ '@/views/demo/dashboard/Workplace'),
          meta: { title: '工作台', keepAlive: true }
        }
      ]
    },
    {
      path: '/demo/form',
      name: 'demo-form',
      redirect: '/demo/form/base',
      component: RouteView,
      meta: { title: '表单页', icon: 'form' },
      children: [
        {
          path: '/demo/form/base',
          name: 'demo-form-base',
          component: () => import(/* webpackChunkName: "form" */ '@/views/demo/form/basicForm'),
          meta: { title: '基础表单', keepAlive: true }
        },
        {
          path: '/demo/form/step',
          name: 'demo-form-step',
          component: () => import(/* webpackChunkName: "form" */ '@/views/demo/form/stepForm/StepForm'),
          meta: { title: '分步表单', keepAlive: true }
        },
        {
          path: '/demo/form/advanced',
          name: 'demo-form-advanced',
          component: () => import(/* webpackChunkName: "form" */ '@/views/demo/form/advancedForm/AdvancedForm'),
          meta: { title: '高级表单', keepAlive: true }
        }
      ]
    },
    {
      path: '/demo/list',
      name: 'demo-list',
      redirect: '/demo/list/table',
      component: RouteView,
      meta: { title: '列表页', icon: 'table' },
      children: [
        {
          path: '/demo/list/table/:pageNo([1-9]\\d*)?',
          name: 'demo-list-table',
          hideChildrenInMenu: true, // 强制显示 MenuItem 而不是 SubMenu
          component: () => import(/* webpackChunkName: "list" */ '@/views/demo/list/TableList'),
          meta: { title: '查询表格', keepAlive: true }
        },
        {
          path: '/demo/list/basic',
          name: 'demo-list-basic',
          component: () => import(/* webpackChunkName: "list" */ '@/views/demo/list/BasicList'),
          meta: { title: '标准列表', keepAlive: true }
        },
        {
          path: '/demo/list/card',
          name: 'demo-list-card',
          component: () => import(/* webpackChunkName: "list" */ '@/views/demo/list/CardList'),
          meta: { title: '卡片列表', keepAlive: true }
        },
        {
          path: '/demo/list/article',
          name: 'demo-list-article',
          component: () => import(/* webpackChunkName: "list" */ '@/views/demo/list/search/Article'),
          meta: { title: '搜索文章' }
        },
        {
          path: '/demo/list/project',
          name: 'demo-list-project',
          component: () => import(/* webpackChunkName: "list" */ '@/views/demo/list/search/Projects'),
          meta: { title: '搜索项目' }
        },
        {
          path: '/demo/list/application',
          name: 'demo-list-application',
          component: () => import(/* webpackChunkName: "list" */ '@/views/demo/list/search/Applications'),
          meta: { title: '搜索应用' }
        }
      ]
    },
    {
      path: '/demo/profile',
      name: 'demo-profile',
      redirect: '/demo/profile/basic',
      component: RouteView,
      meta: { title: '详情页', icon: 'profile' },
      children: [
        {
          path: '/demo/profile/basic',
          name: 'demo-profile-basic',
          component: () => import(/* webpackChunkName: "profile" */ '@/views/demo/profile/basic/index'),
          meta: { title: '基础详情页' }
        },
        {
          path: '/demo/profile/advanced',
          name: 'demo-profile-advanced',
          component: () => import(/* webpackChunkName: "profile" */ '@/views/demo/profile/advanced/Advanced'),
          meta: { title: '高级详情页' }
        }
      ]
    },
    {
      path: '/demo/result',
      name: 'demo-result',
      redirect: '/demo/result/success',
      component: RouteView,
      meta: { title: '结果页', icon: 'check-circle-o' },
      children: [
        {
          path: '/demo/result/success',
          name: 'demo-result-success',
          component: () => import(/* webpackChunkName: "result" */ '@/views/demo/result/Success'),
          meta: { title: '成功页', keepAlive: false, hiddenHeaderContent: true }
        },
        {
          path: '/demo/result/fail',
          name: 'demo-result-fail',
          component: () => import(/* webpackChunkName: "result" */ '@/views/demo/result/Error'),
          meta: { title: '失败页', keepAlive: false, hiddenHeaderContent: true }
        }
      ]
    },

    // Exception
    {
      path: '/demo/exception',
      name: 'demo-exception',
      redirect: '/demo/exception/403',
      component: RouteView,
      meta: { title: '异常页', icon: 'warning' },
      children: [
        {
          path: '/demo/exception/403',
          name: 'demo-exception-403',
          component: () => import(/* webpackChunkName: "fail" */ '@/views/demo/exception/403'),
          meta: { title: '403' }
        },
        {
          path: '/demo/exception/404',
          name: 'demo-exception-404',
          component: () => import(/* webpackChunkName: "fail" */ '@/views/demo/exception/404'),
          meta: { title: '404' }
        },
        {
          path: '/demo/exception/500',
          name: 'demo-exception-500',
          component: () => import(/* webpackChunkName: "fail" */ '@/views/demo/exception/500'),
          meta: { title: '500' }
        }
      ]
    }
  ]
}
